package com.szlanyou.tcp_server_demo.adapter;

import android.os.Handler;
import android.os.Looper;

/**
 * Created by XinYi on 2019/1/14.
 * 运行在主线程
 */

class MainHandler extends Handler {

    private static volatile MainHandler mInstance;

    private MainHandler() {
        super(Looper.getMainLooper());
    }

    public static MainHandler getInstance() {
        if (mInstance == null) {
            synchronized (MainHandler.class) {
                if (mInstance == null) {
                    mInstance = new MainHandler();
                }
            }
        }
        return mInstance;
    }

}